﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_Admin : AdminBaseMaster
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            Page.DataBind();
      
        //  MenuItem menuItem = null;
        if (isLogin())
        {
            
            //LinkBLogin.Visible = false;
            //LinkButton1.Visible = true;
            ////LinkBLogin.PostBackUrl = "~/Default.aspx";
            //lblUserName.Text = "Welcome " + LoginedStaff.Username;
            //Clear Items
            //     NavigationMenu.Items.Clear();
            //   Response.Write(LoginedStaff.RoleID.ToString());
            if (LoginedStaff.RoleID == 3)
            {
                //menuItem = new MenuItem();
                //menuItem.Text = "New Package";
                //menuItem.NavigateUrl = "~/Admin/Package/newPackage.aspx";
                //NavigationMenu.Items.Add(menuItem);

                //menuItem = new MenuItem();
                //menuItem.Text = "Confirm Package";
                //menuItem.NavigateUrl = "~/Admin/ConfirmPackage.aspx";
                //NavigationMenu.Items.Add(menuItem);

                //menuItem = new MenuItem();
                //menuItem.Text = "Package Management";
                //menuItem.NavigateUrl = "~/Admin/Package/ListPackage.aspx";
                //NavigationMenu.Items.Add(menuItem);

                //menuItem = new MenuItem();
                //menuItem.Text = "Monthly Report";
                //menuItem.NavigateUrl = "~/Admin/Report.aspx";
                //NavigationMenu.Items.Add(menuItem);

            }
            else if (LoginedStaff.RoleID == 1)
            {
                //menuItem = new MenuItem();
                //menuItem.Text = "Admin Management Page";
                //menuItem.NavigateUrl = "~/Admin/Management.aspx";
                //NavigationMenu.Items.Add(menuItem);
            }
            //<asp:MenuItem NavigateUrl="~/Admin/Index.aspx" Text="Home" />
            //<asp:MenuItem NavigateUrl="~/Admin/ConfirmPackage.aspx" Text="Confirm Package" />
            //<asp:MenuItem NavigateUrl="~/Admin/Package/ListPackage.aspx" Text="Package Management" />
            //<asp:MenuItem NavigateUrl="~/Admin/Report.aspx" 
            //Text="Monthly Report"></asp:MenuItem>
            //<asp:MenuItem NavigateUrl="~/Admin/Management.aspx" Text="Admin Management Page"></asp:MenuItem>

        }
        else
        {
            //LinkBLogin.Visible = true;
            //LinkButton1.Visible = false;
            //lblUserName.Text = "Please";
            //Clear Items
            //NavigationMenu.Items.Clear();

            //menuItem = new MenuItem();
            //menuItem.Text = "Home";
            //menuItem.NavigateUrl = "~/Admin/Index.aspx";
            //NavigationMenu.Items.Add(menuItem);
            //panelMenu.Visible = false;

        }
    }
    protected void LinkBLogin_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/Admin/Index.aspx");
    }

    protected void LinkBLogin2_Click(object sender, EventArgs e)
    {
        Session.Clear();
        Response.Redirect("~/Admin/Index.aspx");
    }
}

